package com.wwwarehouse.taskcenter.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by clannad.shao on 2017/11/20.
 * Description:
 */

public class ChooseCarriageBean implements Parcelable{


    public ChooseCarriageBean() {
    }

    public ChooseCarriageBean(int total, int size, int page, ArrayList<Carriage> list) {
        this.total = total;
        this.size = size;
        this.page = page;
        this.list = list;
    }

    /**
     * total : 28
     * size : 10
     * page : 1
     * list : [{"brandName":"圆通速递","brandUkid":1001,"brandCode":"YTO"},{"brandName":"京东","brandUkid":1002,"brandCode":"JD"},{"brandName":"申通快递","brandUkid":1004,"brandCode":"STO"},{"brandName":"中通快递","brandUkid":1006,"brandCode":"ZTO"},{"brandName":"百世汇通","brandUkid":1008,"brandCode":"HTKY"},{"brandName":"韵达快递","brandUkid":1010,"brandCode":"YUNDA"},{"brandName":"EMS","brandUkid":1012,"brandCode":"EMS"},{"brandName":"天天快递","brandUkid":1014,"brandCode":"TTKDEX"},{"brandName":"全峰快递","brandUkid":1016,"brandCode":"QFKD"},{"brandName":"邮政国内小包","brandUkid":1018,"brandCode":"POSTB"}]
     */



    private int total;
    private int size;
    private int page;
    private ArrayList<Carriage> list;

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public ArrayList<Carriage> getList() {
        return list;
    }

    public void setList(ArrayList<Carriage> list) {
        this.list = list;
    }

    public static class Carriage implements Parcelable{

        public Carriage() {
        }

        public Carriage(String brandName, String brandUkid, String brandCode) {
            this.brandName = brandName;
            this.brandUkid = brandUkid;
            this.brandCode = brandCode;
        }

        /**
         * brandName : 圆通速递
         * brandUkid : 1001
         * brandCode : YTO
         */

        private String brandName;
        private String brandUkid;
        private String brandCode;

        public String getBrandName() {
            return brandName;
        }

        public void setBrandName(String brandName) {
            this.brandName = brandName;
        }

        public String getBrandUkid() {
            return brandUkid;
        }

        public void setBrandUkid(String brandUkid) {
            this.brandUkid = brandUkid;
        }

        public String getBrandCode() {
            return brandCode;
        }

        public void setBrandCode(String brandCode) {
            this.brandCode = brandCode;
        }

        protected Carriage(Parcel in) {
            brandName = in.readString();
            brandUkid = in.readString();
            brandCode = in.readString();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(brandName);
            dest.writeString(brandUkid);
            dest.writeString(brandCode);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<Carriage> CREATOR = new Creator<Carriage>() {
            @Override
            public Carriage createFromParcel(Parcel in) {
                return new Carriage(in);
            }

            @Override
            public Carriage[] newArray(int size) {
                return new Carriage[size];
            }
        };
    }

    protected ChooseCarriageBean(Parcel in) {
        total = in.readInt();
        size = in.readInt();
        page = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(total);
        dest.writeInt(size);
        dest.writeInt(page);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ChooseCarriageBean> CREATOR = new Creator<ChooseCarriageBean>() {
        @Override
        public ChooseCarriageBean createFromParcel(Parcel in) {
            return new ChooseCarriageBean(in);
        }

        @Override
        public ChooseCarriageBean[] newArray(int size) {
            return new ChooseCarriageBean[size];
        }
    };
}
